﻿using System;
using System.IO;

namespace ArchiveLink
{
    using System.Collections.Generic;

    public class Configuration
    {
        public string MirrorPath { get; set; }
        public bool ConsiderOpticalDisks { get; set; }
        public bool AskOnNewDrives { get; set; }
        public bool AutoSyncOnConnect { get; set; }
        public bool ShowNotifications { get; set; }
        public bool ShowProgress { get; set; }
        //public bool ValidateXBMCDatabase { get; set; }
        public List<uint> ArchiveVolumes { get; set; }

        public Configuration()
        {
            ArchiveVolumes= new List<uint>();
            ConsiderOpticalDisks = false;
            AskOnNewDrives = false;
            AutoSyncOnConnect = true;
            ShowNotifications = false;
            ShowProgress = false;
            MirrorPath = @"C:\Archiv";
        }

        public string GetOfflineDir()
        {
            var progData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
            var progDataDir = new DirectoryInfo(progData);
            var mirrorDir = new DirectoryInfo(MirrorPath);
            if (progDataDir.Root.FullName == mirrorDir.Root.FullName)
            {
                //var appData = new DirectoryInfo(Path.Combine(progData, "ArchiveLink"));
                return Path.Combine(progData, "ArchiveLink", "_Offline");
            }
            else
            {
                return Path.Combine(MirrorPath, "_Offline");    
            }
        }
    }
}
